* FIGURE 1

gl path "~/Dropbox/CovidTurnout/replication"

// declare dependencies


* Subset to states that never adopt no-excuse absentee
* or that adopted no-excuse absentee in 2020
use "$path/original_data/final_VBM_data.dta", clear
egen max_no_excuse = max(no_excuse), by(state)
egen total_no_excuse = total(no_excuse), by(state)
egen last_no_excuse = max(no_excuse*year), by(state)
keep if max_no_excuse==0 | (total_no_excuse==1 & last_no_excuse==2020)

* Plot average turnout across states with and without 
* no-excuse absentee in 2020 
gen turnout = totalballots/VEP
collapse turnout, by(year max_no_excuse)
twoway (connected turnout year if max_no_excuse==0, mc(gs10) lc(gs10)) ///
	(connected turnout year if max_no_excuse==1, mc(gs2) lc(gs2)), ///
	scheme(plotplain) ///
	yti("Turnout (% of Voting-Eligible Pop)") ysc(r(0.45 0.7)) ylab(0.45(0.05)0.7) xti("") ///
	text(0.665 2012 "Switched to") ///
	text(0.65 2012 "Absentee in 2020") text(0.545 2012 "No Absentee") ///
	scale(1.2) graphregion(color(white)) legend(off)
graph export "$path/output/state_turnout.pdf", replace

* Compute the change from 2016 to 2020 and 2012 to 2016
preserve
keep if year>=2012
reshape wide turnout, i(max_no_excuse) j(year)
gen diff2020 = turnout2020 - turnout2016
gen diff2016 = turnout2016 - turnout2012
restore
